package ciyuan.Utils;

import ciyuan.MainClass;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.client.util.InputMappings;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.client.settings.KeyConflictContext;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.client.registry.ClientRegistry;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import org.lwjgl.glfw.GLFW;

@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
public class KeybindingRegisterManager {

    public static final KeyBinding SKILL_KEY1 = new KeyBinding("key.ciyuanrpg.skill.1", KeyConflictContext.IN_GAME, InputMappings.Type.KEYSYM, GLFW.GLFW_KEY_Z,"key.category." + MainClass.MODID);
    public static final KeyBinding SKILL_KEY2 = new KeyBinding("key.ciyuanrpg.skill.2", KeyConflictContext.IN_GAME, InputMappings.Type.KEYSYM, GLFW.GLFW_KEY_V,"key.category." + MainClass.MODID);
    public static final KeyBinding SKILL_KEY3 = new KeyBinding("key.ciyuanrpg.skill.3", KeyConflictContext.IN_GAME, InputMappings.Type.KEYSYM, GLFW.GLFW_KEY_B, "key.category." + MainClass.MODID);
    public static final KeyBinding MAIN_MENU = new KeyBinding("key.ciyuanrpg.menu", KeyConflictContext.IN_GAME, InputMappings.Type.KEYSYM, GLFW.GLFW_KEY_M, "key.category." + MainClass.MODID);

    @SubscribeEvent
    public static void onClientSetup(FMLClientSetupEvent event) {
        event.enqueueWork(() -> ClientRegistry.registerKeyBinding(SKILL_KEY1));
        event.enqueueWork(() -> ClientRegistry.registerKeyBinding(SKILL_KEY2));
        event.enqueueWork(() -> ClientRegistry.registerKeyBinding(SKILL_KEY3));
        event.enqueueWork(() -> ClientRegistry.registerKeyBinding(MAIN_MENU));
    }



}
